<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .grandfather {
            width: 400px;
            height: 400px;
            border: 1px solid red
        }
        .father {
            width: 200px;
            height: 200px;
            border: 1px solid blue
        }
        .son {
            width: 100px;
            height: 100px;
            border: 1px solid green
        }
    </style>
</head>
<body>
    <div id="app">
        <!-- 
            stop -- 阻止冒泡
            self -- 只有点击自身才能执行
            stop.self -- 
            capture  -- 将后面的函数转换为 捕获阶段的函数

            prevent --  阻止默认事件

            native -- (组件有关系)
         -->
        <div class="grandfather" @click.capture="grandfather">
            <div class="father" @click.capture="father">
                <div class="son" @click.capture="son"></div>
            </div>
        </div>
        <a href="" @click.prevent="goto">百度一下</a>
    </div>
    <script src="https://cdn.bootcdn.net/ajax/libs/vue/2.6.14/vue.js"></script>
    <script>
        const app = new Vue({
            el:'#app',
            data: {

            },
            methods: {
                grandfather() {
                    console.log("grandfather -- click")
                },
                father() {
                    console.log("father -- click")
                },
                son() {
                    console.log("son -- click")
                },
                goto() {

                }
            }
        })
    </script>
</body>
</html>